﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true" CodeBehind="FrmProveedor.aspx.cs" Inherits="Intelsi.WB.FrmProveedor" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">

      <script type="text/javascript">
          $(function () {

              

              $("#<%= txtDistrito.ClientID %>").autocomplete({
                  source: "/Service/UbigeoService.asmx/GetAllFromUbigeoByCriterio",
                  minLength: 2,
                  focus: function (event, ui) {
                      var select = ui.item;
                      $(this).val(select.label);

                      $('#<%= txtProvincia.ClientID %>').val(select.ubigeo.provincia);
                      $('#<%= txtDepa.ClientID %>').val(select.ubigeo.departamento);               

                      return false;
                  },

                  select: function (event, ui) {
                      var select = ui.item;
                      $(this).val(select.label);

                                            $('#<%= HFUbigeo.ClientID %>').val(select.value);
                                            $('#<%= txtProvincia.ClientID %>').val(select.ubigeo.provincia);
                                            $('#<%= txtDepa.ClientID %>').val(select.ubigeo.departamento);

           
                      return false;
                  }

              }
          );


              $("#<%= txtBancoBuscar.ClientID %>").autocomplete({
                  source: "/Service/UbigeoService.asmx/GetAllFromBancoByCriterio",
                  minLength: 1,
                  focus: function (event, ui) {
                      var select = ui.item;
                      $(this).val(select.label);


                      return false;
                  },

                  select: function (event, ui) {
                      var select = ui.item;
                      $(this).val(select.label);
                      
                      $('#<%= HFBanco.ClientID %>').val(select.value);
                                          
                     
                      return false;
                  }

              }
          );

          });

  
    </script>


    <style type="text/css">
        .style7
        {
            width: 78px;
            color: #000000;
            font-weight: bold;
            font-size: 15px;
        }
        .style8
        {
            width: 169px;
        }
        .style9
        {
            width: 39px;
        }
        .style10
        {
            width: 223px;
        }
        .style11
        {
            width: 151px;
            color: #000000;
            font-size: 15px;
            font-weight: bold;
        }
        .style13
        {
            color: #000000;
        }
        .style15
        {
            width: 78px;
        }
        .style17
        {
            width: 158px;
        }
        .style18
        {
            width: 228px;
        }
        #D_Ubigeo
        {
            width: 280px;
        }
        .style19
        {
            width: 28px;
        }
        .style31
        {
            width: 98px;
            font-size: 15px;
            color: #000000;
        }
        .style32
        {
            width: 96px;
            color: #000000;
            font-size: 15px;
        }
        .style33
        {
            width: 150px;
        }
        .style34
        {
            width: 114px;
        }
        #D_Contacto
        {
            width: 587px;
        }
        .style36
        {
            width: 41px;
        }
        #D_emp0
        {
            width: 243px;
        }
        #D_emp1
        {
            width: 318px;
        }
        #Table1
        {
            width: 214px;
        }
        .style38
        {
            width: 37px;
            color: #000000;
        }
        .style39
        {
            width: 35px;
        }
        .style40
        {
            width: 348px;
        }
        .style41
        {
            width: 104px;
            
        }
        .Fieldset1
        {
             background-color: #BFC9D9
        }
         
        
        
        .style42
        {
            width: 215px;
        }
        
        
        .style44
        {
            width: 15px;
        }
        .style45
        {
            width: 18px;
        }
        .style47
        {
            width: 37px;
        }
        .style49
        {
            width: 171px;
        }
        
        
        .style50
        {
            width: 61px;
        }
        
        
        .style52
        {
            width: 37px;
            height: 24px;
        }
        .style53
        {
            width: 61px;
            height: 24px;
        }
        .style54
        {
            height: 24px;
        }
        
        
        .style56
        {
            width: 248px;
        }
        
        
        .style57
        {
            width: 125px;
        }
        .style58
        {
            width: 61px;
            color: #000000;
            font-size: 15px;
        }
        
        
        </style>

        

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

        <asp:HiddenField ID="IdHiddenField" runat="server" />
        <asp:HiddenField ID="AccionHiddenField" runat="server" />
      
        <br />
      
        <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
            onobjectcreating="ObjectDataSource2_ObjectCreating" 
            SelectMethod="GetAllFromUbigeo" TypeName="Intelsi.BusinessLogic.UbigeoBL">
        </asp:ObjectDataSource>
      
        <br />
      
        <br />
      
    <table id="1°-par" style="width: 776px">
        <tr>
            <td class="style9">
            </td>
            
            <td class="style8">

                 <fieldset class="Fieldset1">
                    <legend class="style13"><strong>Datos de Empresa</strong></legend>
                          <table id="D_emp">
                    <tr>
                        <td id="Td23" class="style7">
                            Ruc:</td>
                        <td id="Td24" class="style17">
                            <asp:TextBox ID="txtRuc" runat="server" Width="150px" Height="22px"></asp:TextBox>

                       
                             <asp:RegularExpressionValidator ID="Ruc" runat="server" ErrorMessage="Ruc no valido     11 digitos"
                             ControlToValidate="txtRuc" ValidationExpression="\d{11}" style="color: #FF0000"
                             Display="None"></asp:RegularExpressionValidator>

                              <asp:requiredfieldvalidator id="Ruc1" runat="server" 
                             ToolTip="Ver error al final de la página" Display="None" 
                         ControlToValidate="txtRuc" ErrorMessage="Ingresar Ruc" 
                             style="color: #FF0000"></asp:requiredfieldvalidator>


                            <ajaxToolkit:ValidatorCalloutExtender ID="Ruc1_Ve" runat="server" 
                                Enabled="True" TargetControlID="Ruc1">
                            </ajaxToolkit:ValidatorCalloutExtender>


                            <ajaxToolkit:ValidatorCalloutExtender ID="Ruc_Ve" runat="server" Enabled="True" 
                                TargetControlID="Ruc">
                            </ajaxToolkit:ValidatorCalloutExtender>


                        </td>
                    </tr>
                    <tr>
                        <td id="Td25" class="style7">
                            Empresa:</td>
                        <td id="Td26" class="style17">
                            <asp:TextBox ID="txtEmpresa" runat="server" Width="200px" Height="22px"></asp:TextBox>

                            <asp:requiredfieldvalidator id="Empresa" runat="server" 
                             ToolTip="Ver error al final de la página" Display="None" 
                         ControlToValidate="txtEmpresa" ErrorMessage="Ingresar Nombre de empresa" 
                             style="color: #FF0000"></asp:requiredfieldvalidator>
                            <ajaxToolkit:ValidatorCalloutExtender ID="rfvEmpresa_VCE" runat="server" 
                                Enabled="True" TargetControlID="Empresa">
                            </ajaxToolkit:ValidatorCalloutExtender>
                           </td>
                    </tr>
                    <tr>
                        <td id="Td27" class="style7">
                            E-Mail:</td>
                        <td id="Td28" class="style17">
                            <asp:TextBox ID="txtEmail" runat="server" Width="200px" Height="22px"></asp:TextBox>

                            <asp:RequiredFieldValidator ID="Emaile" runat="server" 
                            Display="None" ControlToValidate="txtEmail" ErrorMessage="Ingresar E-mail"
                            style="color: #FF0000"></asp:RequiredFieldValidator>
                            
                             
                            <ajaxToolkit:ValidatorCalloutExtender ID="Emaile_VE" runat="server" 
                                Enabled="True" TargetControlID="Emaile">
                            </ajaxToolkit:ValidatorCalloutExtender>
                            
                             
                            <asp:RegularExpressionValidator ID="Email" runat="server" ControlToValidate="txtEmail"
                            ErrorMessage="E-mail Invalido" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
                            Display="None"  style="color: #FF0000"></asp:RegularExpressionValidator>

                            <ajaxToolkit:ValidatorCalloutExtender ID="Email_Vex" runat="server" 
                                Enabled="True" TargetControlID="Email">
                            </ajaxToolkit:ValidatorCalloutExtender>

                        </td>
                    </tr>
                    <tr>
                        <td id="Td29" class="style7">
                            Telefono:</td>
                        <td id="Td30" class="style17">
                            <asp:TextBox ID="txtTelefono" runat="server" Width="150px" Height="22px"></asp:TextBox>

                            <asp:RequiredFieldValidator ID="Telef" runat="server" 
                            Display="None" ControlToValidate="txtTelefono" ErrorMessage="Ingresar Telefono"
                            style="color: #FF0000"></asp:RequiredFieldValidator>

                            <ajaxToolkit:ValidatorCalloutExtender ID="Telef_VE" runat="server" 
                                Enabled="True" TargetControlID="Telef">
                            </ajaxToolkit:ValidatorCalloutExtender>

                            <asp:RegularExpressionValidator ID="Telefono" runat="server" ErrorMessage="Telefono no valido"
                             ControlToValidate="txtTelefono" ValidationExpression="\d{9}" style="color: #FF0000"
                             Display="None"></asp:RegularExpressionValidator>


                            <ajaxToolkit:ValidatorCalloutExtender ID="Telefono_VE" runat="server" 
                                Enabled="True" TargetControlID="Telefono">
                            </ajaxToolkit:ValidatorCalloutExtender>


                        </td>
                        
                    </tr>

                    <tr>
                    <td class="style15">
                        &nbsp;</td>
                    </tr>

                    </table>
                   
                </fieldset>
                        </td>
             <td class="style19">
            </td>

             <td class="style10">
             <fieldset class="Fieldset1">
                    <legend class="style13"><strong>Datos de Empresa</strong></legend>
                        <table id="D_Ubigeo">
                 
                     <tr>
                         <td id="Td33" class="style11">
                             Pais<asp:HiddenField ID="HFUbigeo" runat="server" />
                         </td>
                         <td id="Td34" class="style18">
                             <asp:DropDownList ID="DowPais" runat="server" Width="150px" Height="26px" 
                                 AutoPostBack="True">
                                 <asp:ListItem>Peru</asp:ListItem>
                                 <asp:ListItem>Otro</asp:ListItem>
                             </asp:DropDownList>
                         </td>
                     </tr>
                     <tr>
                         <td id="Td35" class="style11">
                             Departamento:</td>
                         <td id="Td36" class="style18">
                             <%--<asp:DropDownList ID="DowDepartamento" runat="server" Width="150px" 
                                 Height="26px" DataSourceID="ObjectDataSource2" 
                                 DataTextField="departamento" DataValueField="id">
                             </asp:DropDownList>--%>

                             <asp:TextBox ID="txtDepa" runat="server"  eight="22px"  Width="150px" ></asp:TextBox>
                              <asp:DropDownList ID="DropDownList1" runat="server" 
            DataSourceID="ObjectDataSource3" DataTextField="departamento" 
            DataValueField="departamento" AutoPostBack="True" Visible="false" >
        </asp:DropDownList>
        
        <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" 
            onobjectcreating="ObjectDataSource3_ObjectCreating" 
            SelectMethod="GetAllFromUbigeo" TypeName="Intelsi.BusinessLogic.UbigeoBL">
        </asp:ObjectDataSource>

                         </td>
                     </tr>
                     <tr>
                         <td id="Td37" class="style11">
                             Provincia:</td>
                         <td id="Td38" class="style18">
                            <%-- <asp:DropDownList ID="DowProvincia" runat="server" Width="150px" Height="26px">
                             </asp:DropDownList>--%>
                             <asp:TextBox ID="txtProvincia" runat="server" eight="22px" Width="150px" ></asp:TextBox>
                             <asp:UpdatePanel id="Samuel" runat="server">
                                <ContentTemplate>
                                 <asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True" 
                                          DataSourceID="ObjectDataSource4" DataTextField="provincia" Visible ="false"
                                          DataValueField="provincia">
                                      </asp:DropDownList>

                                  <asp:ObjectDataSource ID="ObjectDataSource4" runat="server" 
                                      onobjectcreating="ObjectDataSource4_ObjectCreating1" SelectMethod="sinServicio" 
                                      TypeName="Intelsi.BusinessLogic.UbigeoBL">
                                      <SelectParameters>
                                          <asp:ControlParameter ControlID="DropDownList1" Name="criterio" 
                                              PropertyName="SelectedValue" Type="String" />
                                      </SelectParameters>
                             </asp:ObjectDataSource>
                                
                              </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="DropDownList1" />
                                </Triggers>
                             </asp:UpdatePanel>
                         </td>
                     </tr>
                     <tr>
                         <td id="Td39" class="style11">
                             Distrito:</td>
                         <td id="Td40" class="style18">
                             <%--<asp:DropDownList ID="DowDistrito" runat="server" Width="150px" Height="26px">
                             </asp:DropDownList>--%>
                             <asp:TextBox ID="txtDistrito" runat="server" Width="150px" Height="22px" ></asp:TextBox>
                             <asp:UpdatePanel ID="hola" runat="server">
      <ContentTemplate>
       
          
         
          <asp:DropDownList ID="DropDownList3" runat="server" Visible ="false"
              DataSourceID="ObjectDataSource5" DataTextField="distrito" DataValueField="id">
          </asp:DropDownList>
          <asp:ObjectDataSource ID="ObjectDataSource5" runat="server" 
              onobjectcreating="ObjectDataSource5_ObjectCreating" SelectMethod="sinServicio2" 
              TypeName="Intelsi.BusinessLogic.UbigeoBL">
              <SelectParameters>
                  <asp:ControlParameter ControlID="DropDownList1" Name="departamento" 
                      PropertyName="SelectedValue" Type="String" />
                  <asp:ControlParameter ControlID="DropDownList2" Name="provincia" 
                      PropertyName="SelectedValue" Type="String" />
              </SelectParameters>
          </asp:ObjectDataSource>
          <br />

        </ContentTemplate>
          <Triggers>
              <asp:AsyncPostBackTrigger ControlID="DropDownList1" />
              <asp:AsyncPostBackTrigger ControlID="DropDownList2" />
          </Triggers>
        </asp:UpdatePanel>
                         </td>
                     </tr>
                     <tr>
                         <td id="Td41" class="style11">
                             Direccion:</td>
                         <td id="Td42" class="style18">
                            <asp:TextBox ID="txtDireccion" runat="server" TextMode="MultiLine" Width="150px"></asp:TextBox>

                            <asp:requiredfieldvalidator id="Direccion" runat="server" 
                             ToolTip="Ver error al final de la página" Display="None" 
                         ControlToValidate="txtDireccion" ErrorMessage="Ingresar Direccion" 
                             style="color: #FF0000"></asp:requiredfieldvalidator>

                             <ajaxToolkit:ValidatorCalloutExtender ID="Direccion_Ve" runat="server" 
                                 Enabled="True" TargetControlID="Direccion">
                             </ajaxToolkit:ValidatorCalloutExtender>

                         </td>
                     </tr>
                 </table>
             </fieldset>
            </td>
        </tr>

    </table>
    <br />

    <table id="Contenedor_Contacto">
        <tr>
            <td class="style34">
            </td>
            <td>
            <fieldset class="Fieldset1">
                <legend class="style13"><strong>Datos del Contacto</strong></legend>
                    <table id="D_Contacto">
                    <tr>
                        <td class="style31">
                            <strong>Nombre:</strong></td>
                        <td class="style42">
                            <asp:TextBox ID="txtNombre" runat="server" Height="22px" Width="200px"></asp:TextBox>
                             <asp:requiredfieldvalidator id="Nombre" runat="server" 
                             Display="None"  ControlToValidate="txtNombre" ErrorMessage="Falta Ingresar Nombres" 
                             style="color: #FF0000"></asp:requiredfieldvalidator>

                            <ajaxToolkit:ValidatorCalloutExtender ID="Nombre_Ve" runat="server" 
                                Enabled="True" TargetControlID="Nombre">
                            </ajaxToolkit:ValidatorCalloutExtender>
                        </td>
                        <td class="style9">
                        </td>
                        <td class="style32">
                            <strong>DNI:</strong></td>
                        <td class="style33">
                            <asp:TextBox ID="TxtDNI" runat="server" Height="22px" Width="120px"></asp:TextBox>

                            <asp:requiredfieldvalidator id="DNI" runat="server" Display="None" 
                         ControlToValidate="TxtDNI" ErrorMessage="Falta Ingresar DNI" 
                             style="color: #FF0000"></asp:requiredfieldvalidator>

                              <ajaxToolkit:ValidatorCalloutExtender ID="DNI_Ve" runat="server" 
                                Enabled="True" TargetControlID="DNI">
                            </ajaxToolkit:ValidatorCalloutExtender>

                              <asp:regularexpressionvalidator id="DNI1" runat="server" Display="None" 
                             ControlToValidate="TxtDNI" ErrorMessage="Ingresar 8 Digitos" 
                             ValidationExpression="\d{8}" style="color: #FF0000"></asp:regularexpressionvalidator>

                            <ajaxToolkit:ValidatorCalloutExtender ID="DNI1_Ve" runat="server" 
                                Enabled="True" TargetControlID="DNI1">
                            </ajaxToolkit:ValidatorCalloutExtender>

                        </td>
                    </tr>

                     <tr>
                        <td class="style31">
                            <strong>Celular 1:</strong></td>
                        <td class="style42">
                            <asp:TextBox ID="txtCel1" runat="server" Width="120px" Height="22px"></asp:TextBox>

                            <asp:regularexpressionvalidator id="Cel1" runat="server" Display="None" 
                             ControlToValidate="txtCel1" ErrorMessage="Celular no valido" 
                             ValidationExpression="\d{9}" style="color: #FF0000"></asp:regularexpressionvalidator>


                            <ajaxToolkit:ValidatorCalloutExtender ID="Cel1_Ve" runat="server" 
                                Enabled="True" TargetControlID="Cel1">
                            </ajaxToolkit:ValidatorCalloutExtender>


                        </td>
                        <td class="style9">
                        </td>
                        <td class="style32">
                            <strong>Celular 2:</strong></td>
                        <td class="style33">
                            <asp:TextBox ID="txtCel2" runat="server" Height="22px" Width="120px"></asp:TextBox>

                             <asp:regularexpressionvalidator id="Cel2" runat="server" Display="None" 
                             ControlToValidate="txtCel2" ErrorMessage="Celular no valido" 
                             ValidationExpression="\d{9}" style="color: #FF0000"></asp:regularexpressionvalidator>


                            <ajaxToolkit:ValidatorCalloutExtender ID="Cel2_Ve" runat="server" 
                                Enabled="True" TargetControlID="Cel2">
                            </ajaxToolkit:ValidatorCalloutExtender>


                        </td>
                    </tr>
                </table>
            </fieldset>
                
            </td>
        </tr>
    </table>
    
    <br />

    <table>
        <tr>
            <td class="style41">
                </td>
            <td class="style36">
                <table style="width: 746px">
                    <tr>
                        
                         <td>
                            <fieldset class="Fieldset1">
                                <legend class="style13"><strong>Datos de Empresa</strong></legend>
                                <table>
                                    <tr>
                                        <td class="style56">
                                                <table style="width: 246px">
                                                    <tr>
                                                        <td class="style45">
                                                            <table id="D_emp0">
                                                                <tr>
                                                                    <td id="Td43" class="style38">
                                                                        <strong>Banco:<br />
                                                                        <br />
                                                                        <br />
                                                                        </strong></td>
                                                                    <td id="Td44" class="style57">
                                                                        <strong>
                                                                        <asp:DropDownList ID="DowBanco" runat="server" Height="25px" Width="120px" 
                                                                            DataSourceID="ObjectDataSource1" DataTextField="Nombre" 
                                                                            DataValueField="IdBanco" Visible="false" >
                                                                        </asp:DropDownList>
                                                                        <asp:HiddenField ID="HFBanco" runat="server" />
                                                                        <asp:TextBox ID="txtBancoBuscar" runat="server" Width="135px" Height="22px"></asp:TextBox>
                                                                        <br />
                                                                        <asp:Button ID="Button3" runat="server" Text="Nuevo" Height="26px" 
                                                                            style="font-weight: 700"  />
                                                                        <br />
                                                                        <br />
                                                                        </strong>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td id="Td45" class="style38">
                                                                        <strong>&nbsp;&nbsp;&nbsp;&nbsp; N° Cuenta:</strong></td>
                                                                    <td id="Td46" class="style57">
                                                                        <strong>
                                                                        <asp:TextBox ID="txtCuenta" runat="server" Height="22px" Width="140px"></asp:TextBox>
                                                                        </strong>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                                                                    </table>
                                                <table style="width: 221px">
                                                    <tr>
                                                        <td class="style44">
                                                            <table id="Table1">
                                                                <tr>
                                                                    <td id="Td1">
                                                                        &nbsp;&nbsp;&nbsp;
                                                                        <fieldset style="width: 176px;" >
                                                                            <legend class="style13"><strong>Tipo Pago</strong></legend>
                                                                            <asp:RadioButtonList ID="RblPago" runat="server" Height="40px" 
                                                                                RepeatDirection="Horizontal" 
                                                                                style="text-align: center; font-weight: 700; color: #000000;" 
                                                                                Width="149px" AutoPostBack="True">
                                                                                <asp:ListItem Text="Credito" Value="0" Selected="True"  />
                                                                                <asp:ListItem Text="Contado" Value="1" />
                                                                            </asp:RadioButtonList>
                                                                        </fieldset>
                                                                        <br />
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td id="Td3">
                                                                        <span class="style13"><strong>Linea 
                                                                        <br />
                                                                        Credito:</strong></span><asp:TextBox ID="txtLineaCredito" runat="server" Height="22px" 
                                                                            Width="70px"></asp:TextBox>
                                                                        &nbsp;<asp:DropDownList ID="DowTipoPago" runat="server" Height="26px" Width="70px">
                                                                            <asp:ListItem>Soles</asp:ListItem>
                                                                            <asp:ListItem>Dolares</asp:ListItem>
                                                                            <asp:ListItem>Euros</asp:ListItem>
                                                                        </asp:DropDownList>
                                                                        <br />
                                                                        <br />
                                                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                        <asp:Button ID="BtnAgregarBanco" runat="server" Height="26px" Text="Agregar" 
                                                                            Width="74px" onclick="BtnAgregarBanco_Click" />
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                </table>
                                               </td>
                                        <td class="style39">
                                        </td>
                                        <td class="style40">
                                            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                                                onobjectcreating="ObjectDataSource1_ObjectCreating" 
                                                SelectMethod="GetAllFromBanco" TypeName="Intelsi.BusinessLogic.BancoBL">
                                            </asp:ObjectDataSource>

                                            <asp:GridView ID="GridProveedor" runat="server" AutoGenerateColumns="False"
                                                Width="436px" > 
                                                <Columns>
                                                
                                                   <%-- <asp:TemplateField HeaderText="Codigo">
                                                        <ItemTemplate>
                                                                   <%#Eval("IdBanco")%>
                                                         </ItemTemplate>
                                                    </asp:TemplateField>--%>

                                                     <asp:TemplateField HeaderText="Banco">
                                                         <ItemTemplate>
                                                                   <%#Eval("Nombre")%>
                                                         </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText="N° Cuenta">
                                                         <ItemTemplate>
                                                                    
                                                                    <asp:TextBox ID="txtCuenta" runat="server" Height="20px" Width="70px"
                                                                    Text = '<%#Eval("NumeroCuenta")%>' MaxLength="20" ></asp:TextBox>

                                                                    <%--<%#Eval("NumeroCuenta")%>--%>    

                                                         </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText="Tipo Pago">
                                                                
                                                          <ItemTemplate>
                                                                   <%#Eval("TipodeCuentas")%>
                                                         </ItemTemplate>
                                                                                                                  
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText="Linea">
                                                         <ItemTemplate>
                                                                   
                                                                  <%-- <asp:TextBox ID="txtLineaCredito" runat="server" Height="20px" Width="50px"
                                                                    Text = '<%#Eval("LineaCredito")%>' ></asp:TextBox>--%>

                                                                   <%#Eval("LineaCredito")%>
                                                                   <%#Eval("TipoPago")%>
                                                         </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText="Editar">
                                                        <ItemTemplate>
                                                            <asp:ImageButton ID="ImageButton1" runat="server" Height="23px" 
                                                                ImageUrl="~/Styles/images/editar.png" 
                                                                Width="21px" onclick="ImageButton1_Click" />
                                                            &nbsp;|
                                                            <asp:ImageButton ID="ImageButton2" runat="server" Height="25px" 
                                                                ImageUrl="~/Styles/images/eliminar.png" Width="26px" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                   
                                                </Columns>
                                                 <EditRowStyle BackColor="#999999" />
                                                 <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                                 <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                                 <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                                  <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                                  <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                                  <SortedAscendingCellStyle BackColor="#E9E7E2" />
                                                  <SortedAscendingHeaderStyle BackColor="#506C8C" />
                                                  <SortedDescendingCellStyle BackColor="#FFFDF8" />
                                                  <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                                            </asp:GridView>
                                        </td>
                                    </tr>
                                </table>
                            </fieldset>
                         </td>
                    </tr>
                </table>

            </td>
    </table>
        

        <br />
        
       
     
       
    <br />

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Button ID="btnGuardar" runat="server" style="text-align: center; font-weight: 700;" 
         Height="30px" onclick="btnGuardar_Click" />
&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" Height="30px" 
        style="font-weight: 700" onclick="btnCancelar_Click" />
        <br />
    <br />

        <asp:Panel ID="Banco" runat="server" style="margin-left: 247px" Width="319px" 
            BackColor="#E5EBF1">

        <fieldset>
            <legend class="style13"><strong>Registrar Nuevo Banco</strong></legend>
            <asp:UpdatePanel runat="server">
                <ContentTemplate>
                     <table>
                <tr>
                    <td class="style47">
                    </td>
                    <td class="style58">
                        <strong>Banco:</strong></td>
                    <td class="style49">
                        <asp:TextBox ID="txtBanco" runat="server" Height="23px" Width="130px"></asp:TextBox>
                    </td>
                </tr>
                 <tr>
                    <td class="style47">
                    </td>
                    <td class="style58">
                        <strong>Tipo:</strong></td>
                    <td class="style49">
                        <asp:DropDownList ID="DowTipo" runat="server" AutoPostBack="True" Height="26px" 
                            Width="130px" >
                            <asp:ListItem Value="True">Entidad Financiera</asp:ListItem>
                            <asp:ListItem Value="False">Caja</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                 <tr>
                    <td class="style52">
                    </td>
                    <td class="style53">
                    </td>
                    <td class="style54">
                    </td>
                </tr>
                 <tr>
                    <td class="style47">
                    </td>
                    <td class="style50">
                        <asp:Button ID="Button1" runat="server" Text="Guardar" Height="26px" Width="80px" 
                            onclick="Button1_Click" style="font-weight: 700; font-size: small" />
                    </td>
                    <td>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:Button ID="Button2" runat="server" Text="Cancelar" style="font-weight: 700; font-size: small"  Height="26px" Width="80px"
                             />
                    </td>
                </tr>
            </table>
                </ContentTemplate>
                 <Triggers>
                         <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
                 </Triggers>
            </asp:UpdatePanel>
         </fieldset>
        </asp:Panel>

        <ajaxToolkit:ModalPopupExtender ID="Banco_MPE" runat="server" 
            BackgroundCssClass="Fondo" PopupControlID="Banco" X="200"
            CancelControlID="Button2" TargetControlID="Button3"> 
        </ajaxToolkit:ModalPopupExtender>

    <br />
  

    </asp:Content>
